import { BaseDecorator } from "../../base/BaseDecorator";
import { IBehaviour } from "../../interface/IBehaviour";
import { EStatus } from "../../common/EnumType";

export class Repeat extends BaseDecorator {
    private limited: number = 3;
    private count: number = 0;

    public onUpdate(): EStatus{
        if (this.count + 1 > this.limited) {
            return EStatus.Success;
        }
        this.parent.reset();
    }

    public addChild(child: IBehaviour): void {
        super.addChild(child);
    }
}